﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.Net.Sockets;
using System.IO;

namespace httpserver_sharp
{
    class App
    {
        public App ()
        {
            var iPAddress = IPAddress.Parse("127.0.0.1");
            var iPEndPoint = new IPEndPoint(iPAddress, 7718);
            var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            socket.Bind(iPEndPoint);
            socket.Listen(10);
            while (true)
            {
                var getSocket = socket.Accept();
                var streamReader = new StreamReader(new NetworkStream(getSocket));
                var text = streamReader.ReadToEnd();
                Console.WriteLine(text);
            }
        }
    }
}
